/* 
 * This file is part of CompetitionGenerator.
 * CompetitionGenerator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * CompetitionGenerator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with CompetitionGenerator. If not, see <http://www.gnu.org/licenses/>.
 */
package competitiongenerator.entities;

import java.util.List;
import java.util.UUID;
import java.util.logging.Logger;

/**
 * Team class.
 * @author Ashitaka
 * @date 11-abr-2009
 */
public class Team {

    /**
     * Logger of the class Team.
     */
    private final Logger logger = Logger.getLogger(Team.class.getName());
    /**
     * The number of competitors in a team.
     */
    private int teamCompetitorsNumber;
    /**
     * The team name.
     */
    private String teamName;
    /**
     * The ID of the team.
     */
    private UUID teamID;
    /**
     * The competitor list of the team.
     */
    private List<CompetitorKarate> teamCompetitors;
    /**
     * The order of the team in a fight.
     */
    private List<CompetitorKarate> teamFightOrder;
    /**
     * The team gym representation
     */
    private String teamGym;
    /**
     * The team country representation.
     */
    private String teamCountry;
    /**
     * The team region representation.
     */
    private String teamRegion;
    /**
     * The team category.
     */
    private List<Category> teamCategory;

    /**
     * Gender conformation of the team.
     */
    private enum teamGender {

        /**
         * Masculine team conformation.
         */
        MASCULINE {

            /**
             * Override Method toString()
             */
            @Override
            public String toString() {
                return "Masculine Team";
            }
        },
        /**
         * Femenine team conformation.
         */
        FEMENINE {

            /**
             * Override Method toString()
             */
            @Override
            public String toString() {
                return "Femenine Team";
            }
        },
        /**
         * Mixt team conformation.
         */
        MIXT {

            /**
             * Override Method toString()
             */
            @Override
            public String toString() {
                return "Mixt Team";
            }
        }
    };

    /**
     * Constructor.
     * @param teamName
     * @param teamCompetitors
     */
    public Team(String teamName, List<CompetitorKarate> teamCompetitors) {
        this.teamID = UUID.randomUUID();
        this.teamName = teamName;
        this.teamCompetitors = teamCompetitors;
        if (!this.teamCompetitors.isEmpty()) {
            this.teamCompetitorsNumber = this.teamCompetitors.size();
        }
    }

    /**
     * Getter.
     * @return
     */
    public List<CompetitorKarate> getTeamCompetitors() {
        return teamCompetitors;
    }

    /**
     * Setter.
     * @param teamCompetitors
     */
    public void setTeamCompetitors(List<CompetitorKarate> teamCompetitors) {
        this.teamCompetitors = teamCompetitors;
    }

    /**
     * Getter.
     * @return
     */
    public int getTeamCompetitorsNumber() {
        return teamCompetitorsNumber;
    }

    /**
     * Setter.
     * @param teamCompetitorsNumber
     */
    public void setTeamCompetitorsNumber(int teamCompetitorsNumber) {
        this.teamCompetitorsNumber = teamCompetitorsNumber;
    }

    /**
     * Getter.
     * @return
     */
    public List<CompetitorKarate> getTeamFightOrder() {
        return teamFightOrder;
    }

    /**
     * Setter.
     * @param teamFightOrder
     */
    public void setTeamFightOrder(List<CompetitorKarate> teamFightOrder) {
        this.teamFightOrder = teamFightOrder;
    }

    /**
     * Getter.
     * @return
     */
    public String getTeamName() {
        return teamName;
    }

    /**
     * Setter.
     * @param teamName
     */
    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    /**
     * Getter.
     * @return
     */
    public List<?> getTeamCategory() {
        return teamCategory;
    }

    /**
     * Setter.
     * @param teamCategory
     */
    public void setTeamCategory(List<Category> teamCategory) {
        this.teamCategory = teamCategory;
    }

    /**
     * Getter.
     * @return
     */
    public String getTeamCountry() {
        return teamCountry;
    }

    /**
     * Setter.
     * @param teamCountry
     */
    public void setTeamCountry(String teamCountry) {
        this.teamCountry = teamCountry;
    }

    /**
     * Getter.
     * @return
     */
    public String getTeamGym() {
        return teamGym;
    }

    /**
     * Setter.
     * @param teamGym
     */
    public void setTeamGym(String teamGym) {
        this.teamGym = teamGym;
    }

    /**
     * Getter.
     * @return
     */
    public String getTeamRegion() {
        return teamRegion;
    }

    /**
     * Setter.
     * @param teamReagion
     */
    public void setTeamRegion(String teamReagion) {
        this.teamRegion = teamReagion;
    }

    /**
     * Getter.
     * @return The teamID.
     */
    public UUID getTeamID() {
        return teamID;
    }

    /**
     * Override method toString()
     * @return
     */
    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("<--Team-->");
        sb.append("\nID: ");
        sb.append(getTeamID());
        sb.append("\nName: ");
        sb.append(getTeamName());
        //TODO End the toString() method.
        return super.toString();
    }
}
